#!/bin/sh

# https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/dev/build/tasks/bin/scripts/opensearch-dashboards-keystore

DIR="/usr/share/opensearch-dashboards"
CONFIG_DIR="/etc/opensearch-dashboards"

if [ -f "${CONFIG_DIR}/node.options" ]; then
    OSD_NODE_OPTS="$(grep -v ^# <${CONFIG_DIR}/node.options | xargs)"
fi

NODE_OPTIONS="$OSD_NODE_OPTS $NODE_OPTIONS" NODE_ENV=production exec node "${DIR}/src/cli_keystore/dist" ${@}
